package com.fpx.metadata.controller;

import com.fpx.metadata.bean.po.RJob;
import com.fpx.metadata.service.RJobService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author caowei
 */
@Api(value="/rjob", tags="作业信息")
@RequestMapping("rjob")
@RestController
public class RJobController {

    @Autowired
    private RJobService rJobService;

    @ApiOperation(value="分页查询", notes = "分页查询")
    @GetMapping("queryListByPage/v1/{page}/{rows}")
    public PageInfo<RJob> queryListByPage(@PathVariable Integer page, @PathVariable Integer rows) {
        return rJobService.queryPageListByWhere(null, page, rows);
    }

    @ApiOperation(value="根据ID查询", notes = "根据ID查询")
    @GetMapping("queryById/{id}")
    public RJob queryById(@PathVariable Long id) {
        return rJobService.queryById(id);
    }

}
